package com.yugao.fintech.antelope.member.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yugao.fintech.antelope.base.model.BasePO;
import com.yugao.fintech.antelope.base.tenant.core.DataIsolation;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 会员账户明细
 *

 */
@Getter
@Setter
@DataIsolation(filterMainTenant = true, filterTenant = true, tableName = "member_account_detail")
@TableName("member_account_detail")
public class AccountDetail extends BasePO {
    @TableId
	private Long id;
	
	/**
	 * 关联的业务id
	 */
	private Long relatedId;
	
	/**
	 * 账户数据
	 */
	private BigDecimal accountData;
	
	/**
	 * 账户类型
	 */
	private String accountType;
	
	/**
	 * 来源类型
	 */
	private String fromType;
	
	/**
	 * 会员id
	 */
	private Long memberId;
	
	/**
	 * 订单号
	 */
	private String orderNo;
	
	/**
	 * 备注
	 */
	private String remark;
	
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createdAt;

    public static LambdaQueryWrapper<AccountDetail> lqw() {
		return Wrappers.lambdaQuery();
	}
}
